#define DEBUG
#include <cstdio>
#define MODS 1000000007
#define MAXN 50
#define MAXA 50
#define MAXSUMA 1500

using namespace std;

long long fact[MAXSUMA+1], unfact[MAXSUMA+1];

long long qpower(long long a, int n) {
  long long s=1;
  for (; n>1; n>>=1) {
    if (n&1) {
      s = s*a%MODS;
    }
    a = a*a%MODS;
  }
  return s*a%MODS;
}

void initFact(int n) {
  fact[0]=1;
  for (int i=1; i<=n; i++) {
    fact[i] = fact[i-1]*i%MODS;
  }
  unfact[n] = qpower(fact[n], MODS-2);
  for (int i=n; i>0; i--) {
    unfact[i-1] = unfact[i]*i%MODS;
  }
}

long long c(int n, int m) {
  return n<=m ? fact[m]*unfact[n]%MODS*unfact[m-n]%MODS : 0;
}

int main() {
  freopen("photo.in", "r", stdin);
  freopen("photo.out", "w", stdout);

  initFact(MAXSUMA);

  static int a[MAXN+1];
  int n;
  long long temp=1;
  scanf("%d", &n);
  for (int i=1; i<=n; i++) {
    scanf("%d", a+i);
    temp = temp*fact[a[i]]%MODS;
  }


  static long long f[MAXN+1][MAXSUMA+1];
  f[0][0]=1;
  for (int i=0, sum=0; i<n; i++, sum+=a[i]) {
    for (int j=0; j<=sum; j++) {
      for (int k=1; k<=a[i+1]; k++) {
	for (int t=0; t<=j && t<=k; t++) {
	  f[i+1][j+a[i+1]-k-t] = (f[i+1][j+a[i+1]-k-t]+f[i][j]*c(t, j)%MODS*c(k-1, a[i+1]-1)%MODS*c(k-t, sum+1-j)%MODS)%MODS;
	}
      }
    }
  }

  printf("%lld\n", f[n][0]*temp%MODS);

  fcloseall();
  return 0;
}
